import request from "@/utils/request";

export const getListAPi = (data?: any) => {
    return request({
        url: `/carfilm.Homeproduct/index`,
        method: "get",
        params: data,
    });
};

export const delApi = (id: number) => {
    return request({
        url: `/carfilm.Homeproduct/delete`,
        method: "delete",
        params: { id },
    });
};

export const addApi = (data: any) => {
    return request({
        url: `/carfilm.Homeproduct/add`,
        method: "post",
        data,
    });
};

export const editApi = (data: any) => {
    return request({
        url: `/carfilm.Homeproduct/update`,
        method: "post",
        data,
    });
};

//切换显示状态
export const changeStatusApi = (id: number, status: number) => {
    return request({
        url: `/carfilm.Homeproduct/setShowInHome`,
        method: "post",
        data: { id, status },
    });
};
